package com.ubst.smartad.impl.admin.user;

import java.sql.*;
import java.util.*;
import java.io.*;

import com.ubst.smartad.common.TimeUtil;
import com.ubst.smartad.logger.Debug;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;

public class UserMngImpl {
	
	Connection con = null;
	private String serverName;
	private Debug debug;
	//private FileHostEnv fhostEnv;


    /** 
     * 생성자
     *   
     *   
    */ 
	public UserMngImpl(Connection con, String serverName, String log_level) {
		this.con = con;
		this.serverName = serverName;
		this.debug = new Debug("UserMngImpl", log_level);
		//this.fhostEnv = FileHostEnv.getInstance(serverName);

	}

	
	/**
	 *  @author Kswany
	 * 	User(사용자) - User jqGrid List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridUserList(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			
			
		/*
		 *  DB value 값세팅 구현 로직 들어갈 부분
		 */
		// 가상데이터
		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("status", "동기화");
		log_data_map.put("submit_date", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob22");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("status", "동기화");
		log_data_map.put("submit_date", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob33");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("status", "동기화");
		log_data_map.put("submit_date", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob44");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("status", "동기화");
		log_data_map.put("submit_date", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob55");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("status", "동기화");
		log_data_map.put("submit_date", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("status", "동기화");
		log_data_map.put("submit_date", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("status", "동기화");
		log_data_map.put("submit_date", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("status", "동기화");
		log_data_map.put("submit_date", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("status", "동기화");
		log_data_map.put("submit_date", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("status", "동기화");
		log_data_map.put("submit_date", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "chob11");
		log_data_map.put("user_name", "설치관리자");
		log_data_map.put("type", "Linux");
		log_data_map.put("system", "redhat");
		log_data_map.put("status", "동기화");
		log_data_map.put("submit_date", "2013-04-02 22:22:00");
		log_datas.add(log_data_map);
		
	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 *  @author Kswany
	 * 	User(사용자) - User jqGrid Log List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridUserLogList(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			

		/*
		 *  DB value 값세팅 구현 로직 들어갈 부분
		 */
		// 가상데이터
		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);
		
		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);

		log_data_map = new HashMap();
		log_data_map.put("user_id", "adminst");
		log_data_map.put("status", "신청");
		log_data_map.put("type", "시스템");
		log_data_map.put("system_name", "centos");
		log_data_map.put("new_account", "기존계정");
		log_data_map.put("join_account", "joins7");
		log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
		log_data_map.put("request_time", "2013-01-13 22:52:01");
		log_datas.add(log_data_map);
		
	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 * @author : Kswany 
	 * User(사용자) - User Info 가져오기 View
	 *	Primary key: system_name(가상설정)
	 */
	public HashMap getUserInfo(String system_name) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();

		try {
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_info_map.put("system_name", "adadmin");
			log_info_map.put("user_id", "adadmin");
			log_info_map.put("user_name", "설치관리자");
			log_info_map.put("dn_submit", "test1234");
			log_info_map.put("org_name", "유비에스티");
			log_info_map.put("dept_name", "기술지원");
			log_info_map.put("position", "사원");
			log_info_map.put("email", "Tech@ubst.co.kr");
			log_info_map.put("handphone", "010-6699-1111");
			log_info_map.put("ip_addr", "192.168.1.1");
			log_info_map.put("expire_date", "2013년01월17일02시27분");
			log_info_map.put("create_date", "2013년01월17일02시27분");
			
			
		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		
		return log_info_map;
	}
	
	/**
	 * @author : Kswany 
	 * User(사용자) - User  비밀번호 변경
	 *	key: pw(가상설정)
	 */
	public boolean updateUserChangePw(String pw) 
	//	throws SQLException {
		throws Exception{
	
		PreparedStatement pstmt=null;
		ResultSet rs = null;
		
		boolean result = false;
		try {
		
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;
		
		}catch (Exception e){
			throw e;
		}finally{
		//	if ( rs != null) try{rs.close();}catch(SQLException ee){}
		//	if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 *  User(사용자) - User insert
	 *	key: system_name(가상설정)
	 */
	public boolean insertUserAdd(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();
		boolean result = false;
		try {

			String insert_group = String.valueOf(param.get("insert_group"));
			String user = String.valueOf(param.get("user"));
			String name = String.valueOf(param.get("name"));
			String pw = String.valueOf(param.get("pw"));
			String pw_check = String.valueOf(param.get("pw_check"));
			String or_name = String.valueOf(param.get("or_name"));
			String dep_name = String.valueOf(param.get("dep_name"));
			String position = String.valueOf(param.get("position"));
			String email = String.valueOf(param.get("email"));
			String handphone = String.valueOf(param.get("handphone"));
			String ip_addr = String.valueOf(param.get("ip_addr"));
			String target_list = String.valueOf(param.get("target_list"));
			String req_account = String.valueOf(param.get("req_account"));
			String use_purpose = String.valueOf(param.get("use_purpose"));
			String use_date = String.valueOf(param.get("use_date"));
			String use_time = String.valueOf(param.get("use_time"));

			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	/**
	 * @author : Kswany 
	 * User(사용자) - User  ID 중복체크
	 *	key: user(가상설정)
	 */
	public boolean checkId(String user) 
	//	throws SQLException {
		throws Exception{
	
		PreparedStatement pstmt=null;
		ResultSet rs = null;
		
		boolean result = false;
		try {
		
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;//사용할수 있을때 true, 없을때 false
		
		}catch (Exception e){
			throw e;
		}finally{
		//	if ( rs != null) try{rs.close();}catch(SQLException ee){}
		//	if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	
	/**
	 * @author : Kswany 
	 * User(사용자) - User delete(list checkbox선택후 삭제, 리스트 마지막으로 클릭 한 상세정보에서 삭제)
	 *	key: checked된 key(가상설정)
	 */
	public boolean deleteUser(List array) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
	
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	/**
	 * @author : Kswany 
	 * User(사용자) - User insertUserInfo
	 *	key: work_no(가상설정)
	 */
	public boolean insertUserInfo(String work_no) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {

			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
	
	
	
	
	
	/**
	 *  @author Kswany
	 * 	User(사용자) - System jqGrid List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridSystemList(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_data_map = new HashMap();
			log_data_map.put("type", "Linux1");
			log_data_map.put("system", "redhat");
			log_data_map.put("user_id", "chob11");
			log_data_map.put("user_name", "설치관리자");
			log_data_map.put("status", "동기화");
			log_data_map.put("submit_date", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("type", "Linux2");
			log_data_map.put("system", "redhat");
			log_data_map.put("user_id", "chob11");
			log_data_map.put("user_name", "설치관리자");
			log_data_map.put("status", "동기화");
			log_data_map.put("submit_date", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux3");
			log_data_map.put("system", "redhat");
			log_data_map.put("user_id", "chob11");
			log_data_map.put("user_name", "설치관리자");
			log_data_map.put("status", "동기화");
			log_data_map.put("submit_date", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux4");
			log_data_map.put("system", "redhat");
			log_data_map.put("user_id", "chob11");
			log_data_map.put("user_name", "설치관리자");
			log_data_map.put("status", "동기화");
			log_data_map.put("submit_date", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux5");
			log_data_map.put("system", "redhat");
			log_data_map.put("user_id", "chob11");
			log_data_map.put("user_name", "설치관리자");
			log_data_map.put("status", "동기화");
			log_data_map.put("submit_date", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux");
			log_data_map.put("system", "redhat");
			log_data_map.put("user_id", "chob11");
			log_data_map.put("user_name", "설치관리자");
			log_data_map.put("status", "동기화");
			log_data_map.put("submit_date", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux");
			log_data_map.put("system", "redhat");
			log_data_map.put("user_id", "chob11");
			log_data_map.put("user_name", "설치관리자");
			log_data_map.put("status", "동기화");
			log_data_map.put("submit_date", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux");
			log_data_map.put("system", "redhat");
			log_data_map.put("user_id", "chob11");
			log_data_map.put("user_name", "설치관리자");
			log_data_map.put("status", "동기화");
			log_data_map.put("submit_date", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux");
			log_data_map.put("system", "redhat");
			log_data_map.put("user_id", "chob11");
			log_data_map.put("user_name", "설치관리자");
			log_data_map.put("status", "동기화");
			log_data_map.put("submit_date", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux");
			log_data_map.put("system", "redhat");
			log_data_map.put("user_id", "chob11");
			log_data_map.put("user_name", "설치관리자");
			log_data_map.put("status", "동기화");
			log_data_map.put("submit_date", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("type", "Linux");
			log_data_map.put("system", "redhat");
			log_data_map.put("user_id", "chob11");
			log_data_map.put("user_name", "설치관리자");
			log_data_map.put("status", "동기화");
			log_data_map.put("submit_date", "2013-04-02 22:22:00");
			log_datas.add(log_data_map);
			
	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 *  @author Kswany
	 * 	User(사용자) - System jqGrid Log List 가져오기
	 * 
	 *  searchStr: 검색조건
	 *  orderBy: sort조건
	 *  prev_page: first limit 
	 *  next_page: last limit
	 *  
	 * **/
	public List getJqgridSystemLogList(String searchStr, String orderBy, int prev_page, int next_page) 
//			throws SQLException{
			throws Exception{
		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_data_map = null;
		List log_datas = new ArrayList();
		
		try{			
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_data_map = new HashMap();
			log_data_map.put("user_id", "adminst");
			log_data_map.put("status", "신청");
			log_data_map.put("type", "시스템");
			log_data_map.put("system_name", "centos");
			log_data_map.put("new_account", "기존계정");
			log_data_map.put("join_account", "joins7");
			log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
			log_data_map.put("request_time", "2013-01-13 22:52:01");
			log_datas.add(log_data_map);
			
			log_data_map = new HashMap();
			log_data_map.put("user_id", "adminst");
			log_data_map.put("status", "신청");
			log_data_map.put("type", "시스템");
			log_data_map.put("system_name", "centos");
			log_data_map.put("new_account", "기존계정");
			log_data_map.put("join_account", "joins7");
			log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
			log_data_map.put("request_time", "2013-01-13 22:52:01");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("user_id", "adminst");
			log_data_map.put("status", "신청");
			log_data_map.put("type", "시스템");
			log_data_map.put("system_name", "centos");
			log_data_map.put("new_account", "기존계정");
			log_data_map.put("join_account", "joins7");
			log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
			log_data_map.put("request_time", "2013-01-13 22:52:01");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("user_id", "adminst");
			log_data_map.put("status", "신청");
			log_data_map.put("type", "시스템");
			log_data_map.put("system_name", "centos");
			log_data_map.put("new_account", "기존계정");
			log_data_map.put("join_account", "joins7");
			log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
			log_data_map.put("request_time", "2013-01-13 22:52:01");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("user_id", "adminst");
			log_data_map.put("status", "신청");
			log_data_map.put("type", "시스템");
			log_data_map.put("system_name", "centos");
			log_data_map.put("new_account", "기존계정");
			log_data_map.put("join_account", "joins7");
			log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
			log_data_map.put("request_time", "2013-01-13 22:52:01");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("user_id", "adminst");
			log_data_map.put("status", "신청");
			log_data_map.put("type", "시스템");
			log_data_map.put("system_name", "centos");
			log_data_map.put("new_account", "기존계정");
			log_data_map.put("join_account", "joins7");
			log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
			log_data_map.put("request_time", "2013-01-13 22:52:01");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("user_id", "adminst");
			log_data_map.put("status", "신청");
			log_data_map.put("type", "시스템");
			log_data_map.put("system_name", "centos");
			log_data_map.put("new_account", "기존계정");
			log_data_map.put("join_account", "joins7");
			log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
			log_data_map.put("request_time", "2013-01-13 22:52:01");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("user_id", "adminst");
			log_data_map.put("status", "신청");
			log_data_map.put("type", "시스템");
			log_data_map.put("system_name", "centos");
			log_data_map.put("new_account", "기존계정");
			log_data_map.put("join_account", "joins7");
			log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
			log_data_map.put("request_time", "2013-01-13 22:52:01");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("user_id", "adminst");
			log_data_map.put("status", "신청");
			log_data_map.put("type", "시스템");
			log_data_map.put("system_name", "centos");
			log_data_map.put("new_account", "기존계정");
			log_data_map.put("join_account", "joins7");
			log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
			log_data_map.put("request_time", "2013-01-13 22:52:01");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("user_id", "adminst");
			log_data_map.put("status", "신청");
			log_data_map.put("type", "시스템");
			log_data_map.put("system_name", "centos");
			log_data_map.put("new_account", "기존계정");
			log_data_map.put("join_account", "joins7");
			log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
			log_data_map.put("request_time", "2013-01-13 22:52:01");
			log_datas.add(log_data_map);

			log_data_map = new HashMap();
			log_data_map.put("user_id", "adminst");
			log_data_map.put("status", "신청");
			log_data_map.put("type", "시스템");
			log_data_map.put("system_name", "centos");
			log_data_map.put("new_account", "기존계정");
			log_data_map.put("join_account", "joins7");
			log_data_map.put("use_date", "2013-05-01 ~ 2013-06-30");
			log_data_map.put("request_time", "2013-01-13 22:52:01");
			log_datas.add(log_data_map);
			
	//	}catch (SQLException e){
		}catch (Exception e){
			throw e;
		}finally{
	//		if ( rs != null) try{rs.close();}catch(SQLException ee){}
	//		if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
	
		return log_datas;
	}
	
	/**
	 * @author : Kswany 
	 * User(사용자) - System Info 가져오기 View
	 *	key: system_name(가상설정)
	 */
	public HashMap getSystemInfo(String system_name) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		HashMap log_info_map = new HashMap();

		try {
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분
			 */
			// 가상데이터
			log_info_map.put("system_name", "adadmin");
			log_info_map.put("user_id", "adadmin");
			log_info_map.put("user_name", "설치관리자");
			log_info_map.put("dn_submit", "test1234");
			log_info_map.put("org_name", "유비에스티");
			log_info_map.put("dept_name", "기술지원");
			log_info_map.put("position", "사원");
			log_info_map.put("email", "Tech@ubst.co.kr");
			log_info_map.put("handphone", "010-6699-1111");
			log_info_map.put("ip_addr", "192.168.1.1");
			log_info_map.put("expire_date", "2013년01월17일02시27분");
			log_info_map.put("create_date", "2013년01월17일02시27분");

			
			
			
		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		
		return log_info_map;
	}

	/**
	 * @author : Kswany 
	 * user popup창 대상목록 + insert
	 * 
	 */
	public boolean insertTarget(HashMap param) 
//			throws SQLException {
			throws Exception{

		PreparedStatement pstmt=null;
		ResultSet rs = null;

		boolean result = false;
		try {
			String target_list = String.valueOf(param.get("target_list"));
			
			/*
			 *  DB value 값세팅 구현 로직 들어갈 부분(list의 key값들  where 조건 대입하여 삭제)
			 */
			// 가상데이터
			result = true;

		}catch (Exception e){
			throw e;
		}finally{
//			if ( rs != null) try{rs.close();}catch(SQLException ee){}
//			if ( pstmt != null) try{pstmt.close();}catch(SQLException ee){}
		}
		return result;
	}
}
